LNode*GetANode(LNode*&HL, int i) {
    if (i <= 0) return NULL;
    LNode* p = HL;
    int k = 1;
    while (p != nullptr && k <= i) {
        p = p->next; // Move to the next node
        k++;
    }
    return p;
}